<?php


namespace App\Service;


use Hyperf\Utils\Parallel;

class IndexService
{

    public function co()
    {
        $par = new Parallel();
        $par->add(function () {
            return 1;
        });

        $par->add(function (){
            return 2;
        });

        $result = $par->wait();

        return $result;
    }


}